/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package load.math;

import core.InPort;
import core.OutPort;
import core.DispatcherPort;
import core.StdNode;
import core.TriggerPort;

/**
 *
 * @author Wijnand
 */
public class IntMultiplication extends StdNode {
	private DispatcherPort resChanged = new DispatcherPort();
	private TriggerPort argChanged = new TriggerPort() {
		@Override
		public void callInternal() {
			resChanged.callTargets();
		}
	};
	private InPort arg1 = new InPort(Integer.class, argChanged);
	private InPort arg2 = new InPort(Integer.class, argChanged);
	private OutPort res = new OutPort(Boolean.class, resChanged)
	{
		@Override
		public Object getValueInternal() {
			return (Integer)arg1.getValue() * (Integer)arg2.getValue();
		}
	};
	
	public IntMultiplication() {
		autoPutPorts();
	}
}
